import request from '@/utils/request'

// 集团应诉案件审批 VO
export interface LawsuitDefenseVO {
  id: number // 主键
  caseReason: string // 案由
  claimant: string // 起诉人
  defendant: string // 涉案单位
  submitter: string //资料提交人
  submitterContact: string //资料提交人联系电话
  caseTarget: string //涉案标的
  claimantContact: string // 起诉人联系电话
  defendantContact: string // 涉案单位联系电话
  submitDate:  string|number // 提交时间
  submitCount: number // 提交份数
  caseSummary: string // 简要案情
  lawsuitReason: string // 被起诉理由
  legalOpinion: string // 法务部意见
  legalSign: string // 法务部签名
  legalSignDate: Date // 法务部签名日期
  supervisorOpinion: string // 分管领导审批意见
  supervisorSign: string // 分管领导签名
  supervisorSignDate: Date // 分管领导签名日期
  generalManageropinion: string //总经理审批意见
  generalManagersign: string //总经理签名
  generalManagerSignDate: Date //总经理签名时间
  chairmanopinion: string //董事长审批意见
  chairmansign: string //董事长签名
  chairmanSignDate: Date //董事长签名时间
  processInstanceId: string // 流程编号
  status: number // 审批状态
  remark: string // 备注
  startUserSelectAssignees: any
  isApproved:any
   [key: string]: any
}

// 集团应诉案件审批 API
export const LawsuitDefenseApi = {
  // 查询集团应诉案件审批分页
  getLawsuitDefensePage: async (params: any) => {
    return await request.get({ url: `/bpm/lawsuit-defense/page`, params })
  },

  // 查询集团应诉案件审批详情
  getLawsuitDefense: async (id: number) => {
    return await request.get({ url: `/bpm/lawsuit-defense/get?id=` + id })
  },

  // 新增集团应诉案件审批
  createLawsuitDefense: async (data: LawsuitDefenseVO) => {
    return await request.post({ url: `/bpm/lawsuit-defense/create`, data })
  },

  // 修改集团应诉案件审批
  updateLawsuitDefense: async (data: LawsuitDefenseVO) => {
    return await request.put({ url: `/bpm/lawsuit-defense/update`, data })
  },

  // 删除集团应诉案件审批
  deleteLawsuitDefense: async (id: number) => {
    return await request.delete({ url: `/bpm/lawsuit-defense/delete?id=` + id })
  },

  // 导出集团应诉案件审批 Excel
  exportLawsuitDefense: async (params:any) => {
    return await request.download({ url: `/bpm/lawsuit-defense/export-excel`, params })
  }
}
